package zzws.cyclework;


import java.util.TimerTask;

import javax.servlet.ServletContext;
import ws.log.*;


/** *//**
 * 统计任务
 * @author westd
 *
 */
public class StatisticsTask extends TimerTask
{

  
    private static boolean isRunning = false;
    //private ServletContext context = null;

    public StatisticsTask(ServletContext context)
    {
       
    }
    
    @Override
    public void run()
    {
        
        if (!isRunning) 
        { 
             isRunning = true; 
             Log.writeDebug("开始执行指定任务",null);
                
             //TODO 添加自定义的详细任务
             executeTask();
                
             //指定任务执行结束
             isRunning = false;
             Log.writeDebug("指定任务执行结束",null); 
         
        } 
        else 
        {
        	Log.writeDebug("上一次任务执行还未结束",null);
        }
    
    }

    /** *//**
     * 执行任务
     */
    public void executeTask()
    {
    	Log.writeDebug("任务1",null);
    	Log.writeDebug("任务2",null);
    }
}
